Skip to content

Instantly share code, notes, and snippets.

@lucian-devops
lucian-devops / 2048-benchmark.mjs
Created July 20, 2026 17:27
LK Forge game-AI benchmark harness — re-runnable headless self-play for the tic-tac-toe / 2048 / Color Lines AIs (backs lkforge.com/blog/benchmarking-game-ai)
// 2048-benchmark.mjs
// Headless self-play harness for the LK Forge 2048 solver.
// Reproduces the reach-rate numbers at https://lkforge.com/blog/benchmarking-game-ai/
//
// The "SHIPPED SOLVER CODE" block is copied VERBATIM from
// public/games/2048/index.html. Math.random is overridden with a seeded RNG so
// the solver's internal sampling AND tile spawns are deterministic/re-runnable.
//
// Run: node 2048-benchmark.mjs

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@caseywatts
caseywatts / bookmarkleting.md
Last active September 11, 2026 08:28
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@pipethedev
pipethedev / go-deslop.md
Created September 7, 2026 13:10
Markdown file to de-slop your go codebase

Go Codebase Cleanup: Remove Defensive Over-Engineering and AI Slop

Audit this Go codebase and aggressively simplify AI-generated, defensive, overly abstract, or unnecessarily generic code.

The goal is to make the code look like it was written by an experienced Go engineer:

  • simple
  • explicit
  • strongly typed
  • boring
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active September 11, 2026 08:27
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@joshenders
joshenders / swap.md
Last active September 11, 2026 08:19
Stop making swap partitions

Stop making swap partitions—use swap files instead!

Swap files have had the same performance characteristics as swap partitions for more than 20 years and yet, linux distributions continue to encourage the use of swap partitions during install.

Swap files are easier to use/add/remove/modify/extend after installation. They're better in every way––use swap files!

  1. Create a swap file.

💡 You can use dd for this too but if your filesystem supports it, fallocate is faster.

@camy7
camy7 / study-word-oddities.mjs
Created September 11, 2026 08:11 — forked from lucian-devops/study-word-oddities.mjs
Reproduce the LK Forge Word-Trivia Myths study — counts word oddities across the 172,835-word ENABLE list
// study-word-oddities.mjs — reproduce the "Word Trivia Myths" study.
//
// Fetches the exact ENABLE open word list the Word Unscrambler ships
// (172,835 words) and prints every number used on
// https://lkforge.com/blog/word-trivia-myths/ . No dependencies; Node 18+.
//
// node scripts/study-word-oddities.mjs
//
// Definitions are deliberately explicit so the counts are reproducible; every
// claim on the page is scoped to this list, not to "English" in the abstract.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="Scripts/jquery-1.9.1.min.js"></script>
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<script src="Scripts/isRockFx.js"></script>
<script>
$(function () {
import hashlib
import json
import logging
import math
import os
@lucian-devops
lucian-devops / README.md
Created August 27, 2026 18:52
Image compression: quality vs file size (JPEG vs WebP) measured on Kodak-24 — reproduces the LK Forge study

Image compression: quality vs file size (JPEG vs WebP), measured

Re-runnable harness behind the LK Forge study How much quality do you lose compressing an image?

It measures, for the 24-image Kodak True Color suite, how small each image gets (bits per pixel) and how close it stays to the original (SSIM, structural similarity, 0–1) across a JPEG and WebP quality sweep, plus lossless PNG / WebP reference points.